Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Safari improvements #34

Merged
merged 5 commits into from
Apr 27, 2024
Merged

Safari improvements #34

merged 5 commits into from
Apr 27, 2024

Conversation

TyHil
Copy link
Member

@TyHil TyHil commented Feb 1, 2024

On the main page, the Header, Projects, and CTA all seem to cause webkit lag.

  • In the header it seems like it's useBlobBg.tsx causing problems. Not sure why.

  • I may have fixed the projects. Apparently it's better to animate translate instead of background-position. It needs testing on an actual mac tho. The animation might be too fast and there may be a line showing up between the two images animating.

  • In the CTA the Blob elements seem to be causing lag but they're not animating so idk why. Maybe also the radial gradients. Or maybe it's just my webkit emulator.

In testing each of these it's probably best to remove the other two from the index.tsx file.

Apparently it's better to animate translate instead of background-position. Needs checking on an actual mac. You may need to remove `Header` and `CTA` from the homepage first as they're also laggy.
Copy link

vercel bot commented Feb 1, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
website-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 22, 2024 2:02am

@TyHil
Copy link
Member Author

TyHil commented Feb 1, 2024

@jasonappah and @Jake3231 would y'all test this and maybe put a little work into it. I was just going around removing things until it stopped lagging, getting more and more specific, maybe y'all can do the same.

@Shaurya0108
Copy link
Member

Shaurya0108 commented Feb 2, 2024

@jasonappah and @Jake3231 would y'all test this and maybe put a little work into it. I was just going around removing things until it stopped lagging, getting more and more specific, maybe y'all can do the same.

There is still a rendering issue with the components on MacOS, I'll look into it too

@Jake3231
Copy link

Jake3231 commented Feb 6, 2024

I can take a look at this too

@Jake3231
Copy link

Jake3231 commented Feb 6, 2024

So far much improved, but not 100% there.

@Jake3231
Copy link

Jake3231 commented Feb 6, 2024

From what I see on Safari 17.3 on macOS 14.3:

  • Much better perf on this branch
  • The background at the top of the page no longer animates
  • The stars animation behind "check out our projects" does have a visible line.
  • The whole "check out our projects" section appears very pixelated
Screenshot 2024-02-06 at 4 23 09 PM

@TyHil
Copy link
Member Author

TyHil commented Feb 7, 2024

An easier but less cool solution could be to conditionally apply some JS/CSS that disables the background animations on Safari.

This could be done by accessing the userAgent string.

What do y'all think?

@jasonappah
Copy link
Member

I had typed out a comment on this pr a couple days ago but apparently didn't hit send here 😔

I'm good with disabling the hero animation on Safari until we can figure out a better solution. Not too sure what other options would be good to explore here tbh. The stars animation wasn't planned/in Figma, it was just a nice to have that I added. If we also need to disable it/remove it all together, that's also fine

@Jake3231
Copy link

Jake3231 commented Feb 7, 2024

An easier but less cool solution could be to conditionally apply some JS/CSS that disables the background animations on Safari.

This could be done by accessing the userAgent string.

What do y'all think?

I agree with @jasonappah that disabling the hero animation for Safari is a fine solution for now to keep the project moving forward on all platforms. Might be a nice low priority fix later. Just something to watch out for, I think iPad reports its user agent as desktop OS X , and iPhone is reporting as iOS. Only actual macOS Safari is having the issue.

@Shaurya0108
Copy link
Member

Shaurya0108 commented Feb 7, 2024

Last time I worked on it the main issue was with using the Blob file and components for animations. They slowed down the performance, which is why I disabled/removed them from the landing page.

@Jake3231
Copy link

@nl32 and I tested on Safari on macOS, this is significantly better now.

@TyHil
Copy link
Member Author

TyHil commented Feb 22, 2024

I think this should be ready then!

@TyHil TyHil marked this pull request as ready for review March 1, 2024 00:12
@Jake3231
Copy link

Tested again on Safari 17.4.1 and it's a bit improved on old and patched versions, but it's still much better on this branch. Apple made some big Safari perf/compatibility fixes over the course of macOS 14's release cycle, and it seems that this is getting some benefit.

@TyHil
Copy link
Member Author

TyHil commented Apr 25, 2024

I've noticed my cpu idles at like 5% on the normal site as opposed to 1% on this branch (Chrome) so these changes are probably good for all browsers.
@Jake3231 are we good to merge this in?

Copy link
Collaborator

@RubenOlano RubenOlano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Runs great :)

@TyHil TyHil merged commit ccf55b0 into develop Apr 27, 2024
2 of 3 checks passed
@TyHil TyHil deleted the safari-performance branch April 27, 2024 00:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants